const process = require('child_process');
const path = require('path');
const os = require('os');
const config = require('./local-config');

const isWindow = os.type() == 'Windows_NT';
const CP_CMD = isWindow ? 'xcopy /s /e /q /y' : 'cp -r';
const DEST_PATH = path.normalize(config.devTomcatWebappPath);

process.exec(`${CP_CMD} ${path.normalize('public/module')} ${path.join(DEST_PATH, 'module')}`);